<?php
class H_B extends Zend_Db_Table_Abstract{
    const STATUS_ON = 1;
    const STATUS_OFF = 0;
    //------------------------------------------------
    public function filterData(&$data){
        foreach ($data as $key => $item){
                if (!in_array($key, $this->_getCols())){
                        unset($data[$key]);
                }
        }
    }

    public function add($data){
        $this->filterData($data);       
        return $this->insert($data);
    }
   
    public function edit($id,$data){
        $this->filterData($data);        
        $where = $this->_db->quoteInto("id = ?", $id);
        return $this->update($data, $where);
    }

    public function del($id){
        $where = $this->_db->quoteInto("id = ?", $id);
        return $this->delete($where);
    }
}